<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>发布新一期众筹</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">发布新一期众筹</div>
        <div class="layui-card-body" style="padding: 15px;height: 500px">
            <form class="layui-form" action="" lay-filter="component-form-group" id="myform" action="javascript:;">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">*众筹期数</label>
                        <div class="layui-input-inline">
                            <input type="number" name="ra_nper" autocomplete="off" placeholder="请输入众筹期数" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">*众筹数量</label>
                        <div class="layui-input-inline">
                            <input type="number" name="ra_num" autocomplete="off" placeholder="请输入众筹数量" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">*到期时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="ra_ltime" class="layui-input" id="test-laydate-type-datetime" placeholder="yyyy-MM-dd HH:mm:ss">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">*状态</label>
                        <div class="layui-input-inline">
                            <select id="type" name="ra_state">
                                <option value="1">开始</option>
                                <option value="4">等待</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn"  lay-filter="component-form-demo1" onclick="sub()" type="button">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="__PUBLIC__/caidongweb/lib/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/caidongweb/lib/ueditor/ueditor.all.js"> </script>
<!--<script type="text/javascript" src="js/plupload/plupload.full.min.js"></script>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>-->

<script type="text/javascript">
    var ue = UE.getEditor('container');
</script>
<script>
    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,router = layui.router()
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,form = layui.form
            ,upload = layui.upload;

        element.render();

        element.on('tab(component-tabs-brief)', function(obj){
            layer.msg(obj.index + '：' + this.innerHTML);
        });

        //日期时间选择器
        laydate.render({
            elem: '#test-laydate-type-datetime'
            ,type: 'datetime'
        });
    });
    function sub()
    {
        $.ajax({
            type:'post',
            url:'{:url("Raise/RaiseAdd")}',
            data:$("#myform").serialize(),
            dataType:'json',
            success: function (data) {
                if(data.code>0){
                    //上传成功
                    layer.msg(data.msg,{icon:6,time:1500});
                    setTimeout(function(){parent.location.reload()},1500);
                }else{
                    layer.msg(data.msg, {icon: 5, time: 1000});
                }
            },
            error: function (data) {
                console.log(data.msg);
            },
        });
    }

</script>
</body>
</html>
